<template>
  <div>
    首页
    <!-- 性别 ： 1：男  2：女  3：保密-->
    <hr>
    <div>
      {{ genderLabel }}----{{ gender }}

    </div>
    <hr>
    <div>
      {{ workOfLabel }}----{{ num }}
    </div>

    <hr>
    <div>
      性别：{{ changeToLabel(genderObj.genderInfo,gender) }}
    </div>
    <div>
      聘用形式：{{ changeToLabel(genderObj.workOf,num) }}
    </div>

  </div>
</template>
<script>
import genderObj from '@/api/enum'
import { changeToLabel } from '@/utils/index'
export default {
  data() {
    return {
      gender: 3,
      num: 3,
      changeToLabel: changeToLabel,
      genderObj: genderObj
    }
  },
  computed: {
    genderLabel() {
      // genderObj.genderInfo      gender匹配后拿到对应项的value
      const findItem = genderObj.genderInfo.find(item => item.value === this.gender)
      return findItem.label
    },
    workOfLabel() {
      const findItem = genderObj.workOf.find(item => item.value === this.num)
      return findItem.label
    }
  }
}
</script>
<style>
</style>
